<?php $this->_extends('_layouts/user_layout'); ?>

<?php $this->_block('pageCss'); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo $css_url; ?>user.css" />
<?php $this->_endblock(); ?>

<?php $this->_block('pageJs'); ?>
<?php $this->_endblock(); ?>



<?php $this->_block('title'); ?>
	注册账户 - 图乐网
<?php $this->_endblock(); ?>



		
<?php $this->_block('contents'); ?>
<section class="content">
	<section class="central">
		<hgroup>
			<h1>邮箱注册</h1>
			<h2>
				仅需30秒，赶快行动吧！
				已经有账号了吗？点击这里<a href="<?php echo url('user/login'); ?>">马上登录</a>
			</h2>
		</hgroup>
	
		<section class="container-box">
			<section class="content">
				<ul class="formErrors">
					<?php $formErrors = $userModel->getValidateError(); if(!empty($formErrors)): ?>
						<?php foreach($formErrors as $item => $errors): ?>
							<li>
								<?php echo $item; ?>
								<ul>
									<?php foreach($errors as $error): ?>
										<li class="error"><?php echo $error; ?></li>
									<?php endforeach; ?>
								</ul>
							</li>
						<?php endforeach; ?>
					<?php endif; ?>
				</ul>
			
				<form name="registerForm" id="registerForm" method="POST">
					<label for="name">姓名</label>
					<div class="input-group">
						<input type="text" name="registerForm[nickname]" id="nickname">
					</div>
	
					<label for="email">电子邮箱</label>
					<div class="input-group">
						<input type="text" name="registerForm[email]" id="email">
                    </div>
					<aside>请填写有效的邮箱地址，再注册完成之前我们需要发送一封邮件以确认</aside>
	
					<section class="half fleft">
						<label for="password">密码</label>
						<div class="input-group">
							<input type="password" name="registerForm[password]" id="password">
	                    </div>
                    </section>
                    <section class="half fleft">
						<label for="password">重复密码</label>
						<div class="input-group">
							<input type="password" name="registerForm[password2]" id="password2">
	                    </div>
                    </section>
                    
					<label for="timezone">城市</label>
					<div class="input-group">
						<select name="registerForm[province]" id="province" class="ff_sf_cr_op_box-shadow2 ff_sf_cr_op_border-radius">
							<?php foreach($addressTab as $p => $citiesAreas): ?>
								<option value="<?php echo $p; ?>"><?php echo $p; ?></option>
							<?php endforeach; ?>
						</select>
						<select name="registerForm[city]" id="city" class="ff_sf_cr_op_box-shadow2 ff_sf_cr_op_border-radius">
						</select>
						<select name="registerForm[area]" id="area" class="ff_sf_cr_op_box-shadow2 ff_sf_cr_op_border-radius">
						</select>
						<script>
							var addressTab = <?php echo json_encode($addressTab); ?>;
							$('#province').change(function(){
								var p = $(this).val();
								$('#city').html('');
								
								$.each(addressTab[p], function(city, areas){
									var option = $('<option/>');
									option.val(city).html(city);
									$('#city').append(option);
								});

								$('#city').change();
							});

							$('#city').change(function(){
								var p = $('#province').val();
								var c = $(this).val();
								$('#area').html('');
								
								$.each(addressTab[p][c], function(k, area){
									var option = $('<option/>');
									option.val(area).html(area);
									$('#area').append(option);
								});
							});

							function addressTabInit()
							{
								var province = <?php echo json_encode($userModel->attributes['province']); ?>;
								var city = <?php echo json_encode($userModel->attributes['city']); ?>;
								var area = <?php echo json_encode($userModel->attributes['area']); ?>;
								if(province && city && area){
									$('#province').val(province).change();
									$('#city').val(city).change();
									$('#area').val(area);
								}else{
									$('#province').change();
								}
							}
						</script>
						
						<?php $this->_element('formvalueinitscript', array('formSelector' => '#registerForm', 'formData' => $userModel->attributes)); ?>

						<script>
							(function($){
								addressTabInit();
							})(window.jQuery);
						</script>
						
					</div>
					
					<section class="half fleft">
						<label for="email">请输入验证码</label>
						<div class="input-group">
							<input type="text" name="registerForm[checkCode]" id="checkCode">
	                    </div>
                    </section>
                    <section class="half fleft">
                    	<label for="email"><a id="reimg">看不清</a></label>
                    	<div class="input-group">
							<img id="checkcode_img" height="42" src="<?php echo url('user/accesscode'); ?>">
						</div>
						<script>
							$('#reimg').click(function(){
								$('#checkcode_img').attr('src', '<?php echo url('user/accesscode'); ?>?r='+Math.random(0,99999));
							});
						</script>
                    </section>
                    <div class="clear"></div>
	
					<!-- <section class="flush-block">
						<input type="checkbox" value="MonthlyNewsletter" name="MonthlyNewsletter" onclick="_gaq.push(['_trackPageview, '/internal/form/signup/terms']);" id="newsletter-subscribe">
						<label class="inline-label" for="newsletter-subscribe">I want to receive monthly tips on email design <em>(unsubscribe at any time)</em></label>
					</section> -->
	
					<section id="submit-sign-up">
						<input type="submit" class="button ff_sf_cr_op_text-shadow-green ff_sf_cr_op_border-radius2" value="注册新账户">
						<aside>
							<input type="checkbox" name="registerForm[terms]" id="terms">
							<label for="terms" class="inline-label">同意 <a href="#">服务条款</a>,以及<br> <a href="#">隐私权保护和个人信息利用政策</label></a>
						</aside>
					</section>
				</form>
			</section>
	
			<aside id="sidebar">
				<blockquote class="fleft">
					<a href="#">QQ登录</a><br>
					百度账号登录<br />
					新浪微博帐号<br />
					人人网帐号<br />
					支付宝帐号<br />
					开心网帐号<br />
					<span class="source fleft">&mdash; 合作账号一键登录图乐网</span>
				</blockquote>
	
				<hgroup class="fleft">
					<h2>我们的服务</h2>
					<ul>
						<li><h3>永久保存上传的相片，并为你提供方便有效的整理</h3></li>
						<li><h3>注册即可获得200M基础空间，随着等级的提升，你将获得更多相片存储空间</h3></li>
						<li><h3>除了从你的电脑上传文件，我们也可以帮助你轻松抓取互联网上你喜爱的图片，一切都是轻松简单的</h3></li>
						<li><h3>还可以写点图文并茂的日记来记录多彩的生活</h3></li><br />
					</ul>
					<h3>More than 400,000 companies in over 100 countries already rely on Campaign Monitor for their email marketing, including:</h3>
				</hgroup>
	
				<ul id="client-listing" class="fleft">
					<li class="fleft" id="twitter"></li>
					<li class="fleft" id="facebook"></li>
					<li class="fleft" id="nike"></li>
					<li class="fleft" id="wwf"></li>
					<li class="fleft" id="intel"></li>
					<li class="fleft" id="apple"></li>
					<li class="fleft" id="hp"></li>
				</ul>
			</aside>
		</section>
	</section>
</section>
<?php $this->_endblock('contents'); ?>















